package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.BaseWarehouseLocationMapper;
import com.sumi.erp.domain.BaseWarehouseLocation;
import com.sumi.erp.service.IBaseWarehouseLocationService;

/**
 * 虚拟仓位Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-28
 */
@Service
public class BaseWarehouseLocationServiceImpl implements IBaseWarehouseLocationService 
{
    @Autowired
    private BaseWarehouseLocationMapper baseWarehouseLocationMapper;

    /**
     * 查询虚拟仓位
     * 
     * @param id 虚拟仓位主键
     * @return 虚拟仓位
     */
    @Override
    public BaseWarehouseLocation selectBaseWarehouseLocationById(Long id)
    {
        return baseWarehouseLocationMapper.selectBaseWarehouseLocationById(id);
    }

    /**
     * 查询虚拟仓位列表
     * 
     * @param baseWarehouseLocation 虚拟仓位
     * @return 虚拟仓位
     */
    @Override
    public List<BaseWarehouseLocation> selectBaseWarehouseLocationList(BaseWarehouseLocation baseWarehouseLocation)
    {
        return baseWarehouseLocationMapper.selectBaseWarehouseLocationList(baseWarehouseLocation);
    }

    /**
     * 新增虚拟仓位
     * 
     * @param baseWarehouseLocation 虚拟仓位
     * @return 结果
     */
    @Override
    public int insertBaseWarehouseLocation(BaseWarehouseLocation baseWarehouseLocation)
    {
        baseWarehouseLocation.setCreateTime(DateUtils.getNowDate());
        return baseWarehouseLocationMapper.insertBaseWarehouseLocation(baseWarehouseLocation);
    }

    /**
     * 修改虚拟仓位
     * 
     * @param baseWarehouseLocation 虚拟仓位
     * @return 结果
     */
    @Override
    public int updateBaseWarehouseLocation(BaseWarehouseLocation baseWarehouseLocation)
    {
        return baseWarehouseLocationMapper.updateBaseWarehouseLocation(baseWarehouseLocation);
    }

    /**
     * 批量删除虚拟仓位
     * 
     * @param ids 需要删除的虚拟仓位主键
     * @return 结果
     */
    @Override
    public int deleteBaseWarehouseLocationByIds(Long[] ids)
    {
        return baseWarehouseLocationMapper.deleteBaseWarehouseLocationByIds(ids);
    }

    /**
     * 删除虚拟仓位信息
     * 
     * @param id 虚拟仓位主键
     * @return 结果
     */
    @Override
    public int deleteBaseWarehouseLocationById(Long id)
    {
        return baseWarehouseLocationMapper.deleteBaseWarehouseLocationById(id);
    }
}
